package sns.action;

import java.util.List;

import sns.bean.User;
import sns.service.UserService;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class GetFriendMapAction extends ActionSupport {

	//injection
	private UserService userService;
	//pass in
	
	//return
	private List<User> followerList;
	private List<User> followeeList;
	
	public List<User> getFollowerList() {
		return followerList;
	}

	public List<User> getFolloweeList() {
		return followeeList;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public String execute(){
		
		User currnetUser = userService.getCurrentUser();
		followeeList = userService.getFollowees(currnetUser);
		followerList = userService.getFollowers(currnetUser);
		System.out.println("##################################get friend");
		for(User user : followerList){
			System.out.println("following" + user.getNickname());
		}
		
		return ActionSupport.SUCCESS;
	}

}
